public class Text {
    public static void main(String[] args) {
        for (int i = 0; i <999999 ; i++) {
            int count = 0;
            int tmp = i;
            while(tmp != 0){
                count++;
                tmp/=10;
            }

            tmp = i;
            int sum = 0;
            while(tmp !=0){
                sum += Math.pow(tmp % 10,count);
                tmp /= 10;
            }
            if(sum == i){
                System.out.println(count+" 位的自幂数为："+i);
            }

        }
    }



    public static void main12(String[] args) {
        int n = 7;
        int i = 2;
        for ( i = 2; i <=6 ; i++) {
            if(n % i == 0){
                System.out.println("不是素数！");
                break;
            }

        }
        if(i > n - 1){
            System.out.println("是素数！");
        }
    }


    //找出1~100之间，既能被3整除，也能被4整除的所有数字
    public static void main11(String[] args) {
        int i = 1;
        while(i <= 100){
            if(i % 3 ==0 && i % 4 == 0) {
                System.out.println(i +" ");
                i++;
                continue;
            }
            i++;
        }
    }


    public static void main10(String[] args) {
        int i = 100;
        while(i <= 200){
            if(i % 3 != 0){
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }


    public static void main9(String[] args) {
        int i = 100;
        while(i <= 200){
            if(i % 3 == 0){
                System.out.println(i);
                break;
            }
            i++;
        }
    }

    public static void main8(String[] args) {
        int j = 1;
        int sum = 0;
        while(j <= 5){
            int i = 1;
            int ret = 1;
            while(i <= j){
                ret *= i;
                i++;
            }
            sum += ret;
            j++;
        }
        System.out.println(sum);
    }


    public static void main7(String[] args) {
        int i = 1;
        int ret = 1;
        while(i <= 5){
            ret *= i;
            i++;
        }
        System.out.println(ret);
    }


    public static void main6(String[] args) {
        int i = 1;
        int sum = 0;
        while(i <= 100){
            sum += i;
            i += 2;//1~100的奇数和
        }
        System.out.println(sum);
    }

    public static void main5(String[] args) {
        int i = 1;
        while(i <= 10) {
            System.out.println(i +"");
            i++;
        }
    }

    public static void main4(String[] args) {
        int year= 2000;
        if(year % 100 !=0){
            if(year % 4 == 0){
                System.out.println(year + "是闰年");
            }else{
                System.out.println(year + "不是闰年");
            }
        }else{
            if(year % 400 ==0) {
                System.out.println(year + "是闰年");
            }else{
                System.out.println(year + "不是闰年");
            }
        }
    }



    public static void main3(String[] args) {
        int a = 9;
        if(a % 2 ==0){
            System.out.println(a + "是偶数");
        }else{
            System.out.println(a + "是奇数");
        }
    }


    public static void main2(String[] args) {
        int a = 10;
        if(a > 10) {
            System.out.println("a > 10");
        }else if(a < 10){
            System.out.println("a < 10");
        }else{
            System.out.println("a == 10");
        }
    }


    public static void main1(String[] args) {
        System.out.println("aaa");
        System.out.println("bbb");
        System.out.println("ccc");

    }




}
